﻿Imports System.Data
Imports System.Data.SqlClient
Imports Entidad
Imports Datos

Public Class ClienteNegocio

    Dim dao1 As New ClienteDatos
    Dim dao2 As New CondicionVentaDatos
    Dim dao3 As New CargoDatos

    Function obtenerClienteXID(codCliente As String, flagActivo As String) As Cliente
        Return dao1.obtenerClienteXID(codCliente, flagActivo)
    End Function

    Function obtenerClientesVinculados(codCliente As String) As DataSet
        Return dao1.obtenerClientesVinculados(codCliente)
    End Function

    Function obtenerClientesXFiltro(codCliente As String, ruc As String, descrip As String,
                                    codVendedor As String, disCodigo As String, proCodigo As String,
                                    depCodigo As String) As DataSet
        Return dao1.obtenerClientesXFiltro(codCliente, ruc, descrip, codVendedor, disCodigo, proCodigo, depCodigo)
    End Function

    Function obtenerClienteSunat(numeroRUC As String) As Cliente
        Return dao1.obtenerClienteSunat(numeroRUC)
    End Function

    Function obtenerProcedenciaCliente() As DataSet
        Return dao1.obtenerProcedenciaCliente()
    End Function

    Function obtenerClaseCliente() As DataSet
        Return dao1.obtenerClaseCliente()
    End Function

    Function obtenerEstadoCliente() As DataSet
        Return dao1.obtenerEstadoCliente()
    End Function

    Function obtenerCategoriaCliente() As DataSet
        Return dao1.obtenerCategoriaCliente()
    End Function

    Function obtenerTipoClienteXClase(codClase As String) As DataSet
        Return dao1.obtenerTipoClienteXClase(codClase)
    End Function

    Function obtenerCondicionVenta() As DataSet
        Return dao2.obtenerCondicionVenta()
    End Function

    Function obtenerTipoEntrega() As DataSet
        Return dao1.obtenerTipoEntrega()
    End Function

    Function registrarCliente(cliente As Cliente, usuario As String) As Boolean
        Return dao1.registrarCliente(cliente, usuario)
    End Function

    Function actualizarCliente(cliente As Cliente) As Boolean
        Return dao1.actualizarCliente(cliente)
    End Function

    Function obtenerGruposClientes() As DataSet
        Return dao1.obtenerGruposClientes()
    End Function

    Function obtenerCargos() As DataSet
        Return dao3.obtenerCargos()
    End Function

    Function obtenerClientePropietarioXID(codCliente As String) As ClientePropietario
        Return dao1.obtenerClientePropietarioXID(codCliente)
    End Function

    Function obtenerClientePersonas(codCliente As String) As DataSet
        Return dao1.obtenerClientePersonas(codCliente)
    End Function

    Function obtenerTiposClientePersonas() As DataSet
        Return dao1.obtenerTiposClientePersonas()
    End Function

    Function registrarClientePropietario(cliPropietario As ClientePropietario) As Boolean
        Return dao1.registrarClientePropietario(cliPropietario)
    End Function

    Function actualizarClientePropietario(cliPropietario As ClientePropietario) As Boolean
        Return dao1.actualizarClientePropietario(cliPropietario)
    End Function

    Function obtenerClientesVinculados(codGrupo As String, codCliente As String) As DataSet
        Return dao1.obtenerClientesVinculados(codGrupo, codCliente)
    End Function

    Function registrarCelularesEmpresa(eceCodigo As String, eceOperador As String, eceTipo As String, eceNumero As String, cliCodigo As String, eceActivo As String) As Boolean
        Return dao1.registrarCelularesEmpresa(eceCodigo, eceOperador, eceTipo, eceNumero, cliCodigo, eceActivo)
    End Function

    Function actualizarCelularesEmpresa(eceCodigo As String, eceOperador As String, eceTipo As String, eceNumero As String, cliCodigo As String, eceActivo As String) As Boolean
        Return dao1.actualizarCelularesEmpresa(eceCodigo, eceOperador, eceTipo, eceNumero, cliCodigo, eceActivo)
    End Function

    Function obtenerEmpresaCelulares(codCliente As String) As DataSet
        Return dao1.obtenerEmpresaCelulares(codCliente)
    End Function

    Function obtenerDireccionesCliente(cia As String, codCliente As String) As DataSet
        Return dao1.obtenerDireccionesCliente(cia, codCliente)
    End Function

    Function registrarClienteEntrega(clienteEntrega As ClienteEntrega) As Boolean
        Return dao1.registrarClienteEntrega(clienteEntrega)
    End Function

    Function actualizarClienteEntrega(clienteEntrega As ClienteEntrega) As Boolean
        Return dao1.actualizarClienteEntrega(clienteEntrega)
    End Function

    Function obtenerDireccionEntregaXID(codEntrega As String) As ClienteEntrega
        Return dao1.obtenerDireccionEntregaXID(codEntrega)
    End Function

    Function obtenerSucursalesXCliente(codCliente As String) As DataSet
        Return dao1.obtenerSucursalesXCliente(codCliente)
    End Function

    Function actualizaSucursalXCliente(codSucursal As String, codCliente As String, flag As String) As Boolean
        Return dao1.actualizaSucursalXCliente(codSucursal, codCliente, flag)
    End Function

    Function obtenerMotivosBloqueos() As DataSet
        Return dao1.obtenerMotivosBloqueos()
    End Function

    Function obtenerMotivosLineaCredito() As DataSet
        Return dao1.obtenerMotivosLineaCredito()
    End Function

    Function actualizarLineaCreditoXCliente(cliCodigo As String, codMotivo As String, montoNuevo As Decimal, montoActual As Decimal, usuario As String) As Boolean
        Return dao1.actualizarLineaCreditoXCliente(cliCodigo, codMotivo, montoNuevo, montoActual, usuario)
    End Function

    Function obtenerConceptosXCliente(codCliente As String) As DataSet
        Return dao1.obtenerConceptosXCliente(codCliente)
    End Function

    Function obtenerTipoConceptos() As DataSet
        Return dao1.obtenerTipoConceptos()
    End Function

    Function registrarClienteConcepto(cliCodigo As String, codConcepto As String, descripcion As String, usuario As String) As Boolean
        Return dao1.registrarClienteConcepto(cliCodigo, codConcepto, descripcion, usuario)
    End Function

    Function actualizartClienteConcepto(cliCodigo As String, codConcepto As String, descripcion As String, usuario As String, codRegistro As String) As Boolean
        Return dao1.actualizartClienteConcepto(cliCodigo, codConcepto, descripcion, usuario, codRegistro)
    End Function

End Class
